package com.kun.mongo.controller;

import com.kun.mongo.model.User;
import com.kun.mongo.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author zhoukun
 * @Date 2021/5/1 23:34
 */
@RestController
public class MongoController {

    @Autowired
    UserRepository repository;


    @GetMapping("/mongoTest/findAll")
    public String findAll()
    {
        List<User> all = repository.findAll();
        return all.toString();
    }
}
